/******************************init****************************/
function queryParkRecruit(page) {
	var parm = $('#queryParkRecruitForm').serialize() + (page != null ? ('&page=' + page) : '');
	var url = create_url('parkrecruit-query');
	sys_record_parm('parkrecruit',parm);
	sys_loading();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			$('#resultList').html(result);
		}
	});
}

function deleteParkRecruit(code) {
	$.Zebra_Dialog('是否删除',{
				'type': 'question',
				'title': '警告' ,
				'buttons':[
				           {caption:'删除',callback:function() {
				        	  var url = create_url('parkrecruit-delete');
							   parkRecruit_aidExecute(code, url);
				    		}},
				           {caption:'取消',callback:function(){}
				    	}]
				});
}
function parkRecruit_aidExecute(code, url) {
	var parm = {'code':code};
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_submiting_close();
			if ('success' == result) {
				sys_msg('操作成功');
				queryParkRecruit();
			} else {
				sys_msg('操作失败');
				queryParkRecruit();
			}
		}
	});
}
/************edit******************/
function saveParkRecruit() {
	var parm = $('#editParkOgranForm').serialize();
	var url = create_url('parkrecruit-save');
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
		sys_submiting_close();
			if ('success' == result) {
				sys_msg('操作成功!');
				sys_load_handle('parkrecruit');
			}
		}
	});
}
function selectRecruit() {
		var url = create_url('parkrecruit-queryRecruitInit');
		var parm = {};
		$.colorbox({overlayClose:false, href:url, data:parm, close:'[关闭]', width:'900px',height:'600px', open:true});
}
function checkedParkRecruit(){
	var sort = $("#sort").val();
	var name = $("#name").val();
	var post = $("#post").val();
	if(post.length==0){
		sys_msg('必须选择招聘信息');
		return
	}
	if(sort.length==0){
		sys_msg('必须填写序号');
		return
	}else if(!$.isNumeric(sort)){
		sys_msg('排行序号必须是数字');
		return
	}
	saveParkRecruit();
}
/******************************aidinit****************************/
function queryRecruit(page) {
	var parm = $('#queryRecruitForm').serialize() + (page != null ? ('&page=' + page) : '');
	var url = create_url('parkrecruit-queryRecruitList');
	sys_loading();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			$('#resultList').html(result);
		}
	});
}
function chooseRecruit(code, name,post,oc) {
	$("#rc").val(code);
	$("#post").val(post);
	$("#name").val(name);
	$("#oc").val(oc);
	$.fn.colorbox.close();
}
$(".txt_organlist_name").keydown(function(event) {
	if (event.keyCode == '13') {
		queryOrgan();
		return false;
	}
});
/******************************aidbatchinit****************************/
